/****************************************************************************
**
** Profession.h
**
** Copyright (C) August 2014 Hotride
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
*****************************************************************************
*/
//---------------------------------------------------------------------------
#ifndef ProfessionH
#define ProfessionH
//----------------------------------------------------------------------------
class TProfessionCategory;
//---------------------------------------------------------------------------
class TProfession
{
private:
	string m_DefName;
	string m_Name;
	bool m_Type; //false - Category; true - Profession
	WORD m_Gump;
	
	BYTE m_SkillID[3];
	BYTE m_SkillValue[3];
	BYTE m_Str;
	BYTE m_Int;
	BYTE m_Dex;

	string m_Description;

public:
	TProfession();
	~TProfession();
	
	TEXT_TEXTURE_HEADER m_TextureName;
	TEXT_TEXTURE_HEADER m_TextureDescription;

	TProfessionCategory *m_Parent;

	float m_ScrollHeight;
	
	SETGET(string, DefName)
	SETGET(bool, Type)
	SETGET(WORD, Gump)
	SETGET(BYTE, Str)
	SETGET(BYTE, Int)
	SETGET(BYTE, Dex)
	SETGET(string, Description)
	
	void SetName(string str);
	void SetSkillID(int index, BYTE val) {if (index >= 0 && index <3) m_SkillID[index] = val;}
	void SetSkillValue(int index, BYTE val) {if (index >= 0 && index <3) m_SkillValue[index] = val;}

	string GetName() const {return m_Name;}
	BYTE GetSkillID(int index) const {if (index >= 0 && index <3) return m_SkillID[index]; else return 0xFF;}
	BYTE GetSkillValue(int index) const {if (index >= 0 && index <3) return m_SkillValue[index]; else return 0xFF;}
	
	bool AddDescription(string name, const char *val, int Height);
};
//---------------------------------------------------------------------------
class TProfessionCategory
{
private:
	string m_DefName;
	string m_Name;
	bool m_Type; //false - Category; true - Profession
	WORD m_Gump;

	string m_Description;

public:
	TProfessionCategory();
	~TProfessionCategory();
	
	TEXT_TEXTURE_HEADER m_TextureName;
	TEXT_TEXTURE_HEADER m_TextureDescription;

	TProfessionCategory *m_Parent;

	float m_ScrollHeight;

	string Childs[4];

	int m_CatChildCount;
	TProfessionCategory *m_CatChild[4];

	int m_ProfChildCount;
	TProfession *m_ProfChild[4];
	
	SETGET(string, DefName)
	SETGET(bool, Type)
	SETGET(WORD, Gump)
	SETGET(string, Description)
	
	void SetName(string str);
	
	string GetName() const {return m_Name;}
	
	bool AddDescription(string name, const char *val, int Height);
	bool AddCategory(TProfessionCategory *pc, bool TopObj = false);
	bool Add(TProfession *p);
	void AddChildren(string children);
};
//---------------------------------------------------------------------------
#endif